package jsfHello;

import java.util.Date;

public class NameProcessor {

	private static NameProcessor instace = null;
	
	private NameProcessor() {
		
	}
	
	public static NameProcessor getInstace() {
		if (instace == null) {
			instace = new NameProcessor();
		}
		return instace;
	}
	
	public String doProcess(String name) {
		if (name == null) {
			name = "anonymous";
		}
		String processedName = "";
		if (name.length() > 0) {
			processedName = name.substring(0, 1).toUpperCase();
		}
		if (name.length() > 1) {
			processedName+= name.substring(1).toLowerCase();
		}
		processedName+= " at " + new Date()+".";
		return processedName;
	}
	
}
